package SingletonPattern;
//饿汉模式，创建唯一实例非常早
class SingletonHungry {
    private static SingletonHungry instence = new SingletonHungry();
    public static SingletonHungry getInstance() {
        return instence;
    }
    private SingletonHungry() {

    }
}
public class HungryMode {
    public static void main(String[] args) {
        SingletonHungry s1 = SingletonHungry.getInstance();
        SingletonHungry s2 = SingletonHungry.getInstance();
        System.out.println(s1 == s2);
    }
}
